package com.yisu.expressway.api.domain.request;

/**
 * Created by xlt on 2017/4/28.
 */
public class GoodsCategoryRequest extends BasePage{

    private String parentCode;

    private String categoryCode;

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    /**
     * 方法封装分类枚举
     */
    public enum EnumForFuncEncapsulation {
        DATA_ALL(1, "获取全部分类列表"),

        DATA_FIRST(2, "获取一级商品分类"),

        DATA_PARENT(3, "通过父节点ID，获取子集商品分类");

        public int code;
        public String name;

        EnumForFuncEncapsulation(int code, String name) {
            this.code = code;
            this.name = name;
        }

        static String getEnumNameByCode(int code) {
            for (EnumForFuncEncapsulation item : EnumForFuncEncapsulation.values()) {
                if (item.code == code)
                    return item.name;
            }
            return null;
        }

        static EnumForFuncEncapsulation getTypeByCode(int code) {
            for (EnumForFuncEncapsulation item : EnumForFuncEncapsulation.values()) {
                if (item.code == code)
                    return item;
            }
            return null;
        }
    }

}
